package com.example.chat.receptionist.controller;

import com.example.chat.common.utils.ConvertUtils;
import com.example.chat.common.utils.ResultUtil;
import com.example.chat.receptionist.pojo.dto.ReceptionistDTO;
import com.example.chat.receptionist.pojo.vo.ReceptionistSaveVO;
import com.example.chat.receptionist.service.ReceptionistService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/receptionist")
public class ReceptionistController {
    @Resource
    ReceptionistService receptionistService;

    @PostMapping("/save")
    public ResultUtil<Void> save(@RequestBody ReceptionistSaveVO vo) {
        receptionistService.save(ConvertUtils.of(vo, ReceptionistDTO.class));
        return ResultUtil.ok();
    }

}
